home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / menus.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-30  |  14.8 KB  |  604 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. /*  Menus.c  */
  22.  
  23. #include <externs.h>
  24.  
  25.  
  26. /************************************************************************/
  27. /***   Inicializa o Mouse no Video                                    ***/
  28. /*                                                                      */
  29. void AVL_MOUSE_INIT()
  30. {
  31.     union REGS inreg, outreg;
  32. return;
  33.     inreg.x.ax = 0;
  34.     int86(0x33, &inreg, &outreg);
  35.     inreg.x.ax = 1;
  36.     int86(0x33, &inreg, &outreg);
  37. }
  38.  
  39. void AVL_MOUSE_ON()
  40. {
  41.     union REGS inreg, outreg;
  42. return;
  43.     inreg.x.ax = 1;
  44.     int86(0x33, &inreg, &outreg);
  45. }
  46.  
  47. void AVL_MOUSE_OFF()
  48. {
  49.     union REGS inreg, outreg;
  50. return;
  51.     inreg.x.ax = 2;
  52.     int86(0x33, &inreg, &outreg);
  53. }
  54.  
  55.  
  56. void AVL_MOUSE_SET(int x, int y)
  57. {
  58.     union REGS inreg, outreg;
  59. return;
  60.     inreg.x.ax = 4;
  61.     inreg.x.cx = x;
  62.     inreg.x.dx = y;
  63.     int86(0x33, &inreg, &outreg);
  64. }
  65.  
  66.  
  67. /************************************************************************/
  68. /***   Fornece o Status do Mouse - Posicao, Botao Precionado.            ***/
  69. /**    Botoes: 0 - esquerda                                            **/
  70. /*             1 - direita          Obs.: Definir estrutura de volta    */
  71. /*             2 - meio                   fora do programa.  xmouse     */
  72. /*                                                           ymouse     */
  73. /*    Retorna:  1 - se botao pressionado                                */
  74. /*              0 - caso contrario ou se nro. do botao for invalido     */
  75. /*                                                                      */
  76. AVL_MOUSE AVL_MOUSE_STATUS()
  77. {
  78.     union REGS inreg, outreg;
  79.     static AVL_MOUSE m;
  80.     short i;
  81. m.status = 0;
  82. return m;
  83.  
  84.     inreg.x.ax = 3;
  85.     inreg.x.bx = 0;
  86.  
  87.     int86(0x33, &inreg, &outreg);
  88.  
  89.     m.x = outreg.x.dx;
  90.     m.y = outreg.x.cx;
  91.     m.x = m.x / 8 + 1;
  92.     m.y = m.y / 8 + 1;
  93.     m.status = outreg.x.bx;
  94.  
  95.     return(m);
  96. }
  97.  
  98.  
  99.  
  100. int AVL_MOUSE_SELECT(int x1, int y1, int x2, int y2, int *row)
  101. {
  102.     AVL_MOUSE m;
  103.     m = AVL_MOUSE_STATUS();
  104. return 0;
  105.     if (m.x >= x1 && m.x <= x2 && m.y >= y1 && m.y <= y2 && m.status == 1) {
  106.         *row = m.x - x1;
  107.         avl_cur_smenu[avl_cur_menu] = *row;
  108.         AVL_SHOW_SMENU();
  109.         return 1;
  110.         }
  111.     return 0;
  112. }
  113.  
  114. int AVL_MOUSE_SELECT2(int *item)
  115. {
  116.     AVL_MOUSE m;
  117.     short k, y1, y2;
  118.     m = AVL_MOUSE_STATUS();
  119. return 0;
  120.     if (m.x == 2 && m.status == 1)  
  121.         for(k = 0; k < AVL_MENU_ITEMS; ++k)    {
  122.             y1 = avl_menu[k].c + 1;
  123.             y2 = strlen(avl_menu[k].tit) + y1 - 1;
  124.             if (m.y >= y1 && m.y <= y2 && k != avl_cur_menu)   {
  125.                 *item = avl_menu[k].tit[0];
  126.                 avl_cur_menu = k;
  127.                 AVL_SHOW_MENU();
  128.                 return 1;
  129.                 }
  130.             }
  131.     *item = avl_menu[avl_cur_menu].tit[0];
  132.     return (m.status == 1) ? 1 : 0;
  133. }
  134.  
  135.  
  136. void AVL_SHOW_SMENU()
  137. {
  138.     int i, j, rows = 0, cols = 0;
  139.     short co;
  140.     for(i = 0; *(avl_smenu[avl_cur_menu].s[i].sm) != '\0'; ++i) {
  141.         _settextposition(avl_smenu[avl_cur_menu].r+i,1);
  142.         if (avl_cur_smenu[avl_cur_menu] == i)
  143.             co = _settextcolor(avl_men_ready);
  144.         else
  145.             co = _settextcolor(avl_men_letter);
  146.         _outmem(avl_smenu[avl_cur_menu].s[i].sm,1);
  147.         if (avl_cur_smenu[avl_cur_menu] != i)
  148.             _settextcolor(avl_men_word);
  149.         _outtext(avl_smenu[avl_cur_menu].s[i].sm + 1);
  150.         }
  151. }
  152.  
  153.  
  154. int AVL_GET_SMENU_OPT()
  155. {
  156.     int ch, i, j;
  157.     short att, c1;
  158.     int rows, cols;
  159.     AVL_WIN_PTR w = NULL;
  160.     AVL_SHOW_MENU();
  161.     AVL_COMP_SMENU(&rows,&cols);
  162.     AVL_MOUSE_ON();
  163.     AVL_MOUSE_SET(2,2);
  164.     avl_no_up_corner = 1;
  165.     c1 = avl_menu[avl_cur_menu].c - 1;
  166.     ch = 78 - (c1 + cols);
  167.     if (ch < 0) c1 += ch;
  168.     if (!(rows == 0 && cols == 0))
  169.         w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  170.     _settextcursor(0x2000);
  171.     while ( 1 ) {
  172.         if (w != NULL)
  173.             AVL_SHOW_SMENU();
  174.         _settextposition(1,1);
  175. again:
  176.         if (!kbhit())  {
  177.             if (AVL_MOUSE_SELECT(4,c1+1,rows+3,c1+cols,&i))  {
  178.                 AVL_DEL_WINDOW(w);
  179.                 if (avl_smenu[avl_cur_menu].s[i].ret_edit) {
  180.                     ch = 0;
  181.                     AVL_DEL_WINDOW(avl_env_win);
  182.                     AVL_RESTORE_ENV();
  183.                     }
  184.                 else
  185.                     ch = *(avl_smenu[avl_cur_menu].s[i].sm);
  186.                 avl_smenu[avl_cur_menu].s[i].proc();
  187. /*                if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  188.                     AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  189. */
  190.                 avl_no_up_corner = 0;
  191.                 AVL_MOUSE_OFF();
  192.                 return ch;
  193.                 }
  194.             goto again;
  195.             }
  196.         ch = getch();
  197.         ch = toupper(ch);
  198.         if (ch >= 'A' && ch <= 'Z')   {
  199.             if (w == NULL)  {
  200.                 AVL_ERROR("Invalid action");
  201.                 continue;
  202.                 }
  203.             for (i = 0; i < rows; ++i)
  204.                 if (*(avl_smenu[avl_cur_menu].s[i].sm) == ch) {
  205.                     avl_cur_smenu[avl_cur_menu] = i;
  206.                     AVL_DEL_WINDOW(w);
  207.                     if (avl_smenu[avl_cur_menu].s[i].ret_edit) {
  208.                         ch = 0;
  209.                         AVL_DEL_WINDOW(avl_env_win);
  210.                         AVL_RESTORE_ENV();
  211.                         }
  212.                     avl_smenu[avl_cur_menu].s[i].proc();
  213. /*                    if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  214.                         AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  215. */
  216.                     avl_no_up_corner = 0;
  217.                     AVL_MOUSE_OFF();
  218.                     return ch;
  219.                     }
  220.             continue;
  221.             }
  222.         else {
  223.             switch( ch ) {
  224.                 case  27  : /* Abort Menu */
  225.                     AVL_DEL_WINDOW(w);
  226.                     avl_no_up_corner = 0;
  227.                     AVL_MOUSE_OFF();
  228.                     return 1;
  229.                 case  13  : /* Engage current selection */
  230.                     AVL_DEL_WINDOW(w);
  231.                     ch =  *(avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].sm);
  232.                     if (avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].ret_edit) {
  233.                         ch = 0;
  234.                         AVL_DEL_WINDOW(avl_env_win);
  235.                         AVL_RESTORE_ENV();
  236.                         }
  237.                     avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].proc();
  238. /*                    if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  239.                         AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  240. */
  241.                     avl_no_up_corner = 0;
  242.                     AVL_MOUSE_OFF();
  243.                     return ch;
  244.                 case 0   : 
  245.                 case 0XE0: {
  246.                     ch = getch();
  247.                     switch(ch)  {
  248.                         case 72 : /* Up  */ 
  249.                             if (avl_cur_smenu[avl_cur_menu] > 0)
  250.                                 --avl_cur_smenu[avl_cur_menu];
  251.                             else
  252.                                 avl_cur_smenu[avl_cur_menu] = rows - 1;
  253.                             break;
  254.                         case 80 : /* Down */ 
  255.                             if (avl_cur_smenu[avl_cur_menu] < (rows - 1))
  256.                                 ++avl_cur_smenu[avl_cur_menu];
  257.                             else
  258.                                 avl_cur_smenu[avl_cur_menu] = 0;
  259.                             break;
  260.                         case 75 : /* Left  */ 
  261.                             if (avl_cur_menu > 0) 
  262.                                 --avl_cur_menu; 
  263.                             else
  264.                                 avl_cur_menu = 8;
  265.                             AVL_DEL_WINDOW(w);
  266.                             w = NULL;
  267.                             AVL_SHOW_MENU();
  268.                             AVL_COMP_SMENU(&rows,&cols);
  269.                             c1 = avl_menu[avl_cur_menu].c - 1;
  270.                             ch = 78 - (c1 + cols);
  271.                             if (ch < 0) c1 += ch;
  272.                             if (!(rows == 0 && cols == 0))
  273.                                 w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  274.                             _settextcursor(0x2000);
  275.                             break;
  276.                         case 77 : /* Right */ 
  277.                             if (avl_cur_menu < 8) 
  278.                                 ++avl_cur_menu; 
  279.                             else
  280.                                 avl_cur_menu = 0;
  281.                             AVL_DEL_WINDOW(w);
  282.                             w = NULL;
  283.                             AVL_SHOW_MENU();
  284.                             AVL_COMP_SMENU(&rows,&cols);
  285.                             c1 = avl_menu[avl_cur_menu].c - 1;
  286.                             ch = 78 - (c1 + cols);
  287.                             if (ch < 0) c1 += ch;
  288.                             if (!(rows == 0 && cols == 0))
  289.                                 w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  290.                             else
  291.                                 w = NULL;
  292.                             _settextcursor(0x2000);
  293.                             break;
  294.                         default : putch(7); break;
  295.                         }
  296.                     break;
  297.                     }
  298.                 default : putch(7); break;
  299.                 }
  300.             }
  301.         }  /*  While  */
  302. }
  303.  
  304. char env_saved = 0;
  305.  
  306. void AVL_SAVE_ENV()
  307. {
  308.     AVL_EDIT_WINDOW_PTR wa;
  309.     env_saved = '1';
  310.     wa = &avl_windows[avl_window];
  311.     wa -> sw.bk = _getbkcolor();
  312.     wa -> sw.co = _gettextcolor();
  313.     memmove(wa -> sw.video, 0xb8000, 4000);
  314.     _gettextwindow(&wa -> sw.r1,&wa -> sw.c1,&wa -> sw.r2,&wa -> sw.c2);
  315.     wa -> sw.pos = _gettextposition();
  316. }
  317.  
  318. void AVL_RESTORE_ENV()
  319. {
  320.     AVL_EDIT_WINDOW_PTR wa;
  321.     short *s, *d;
  322.     char *p;
  323.     unsigned char c, att;
  324.     short i, j;
  325. /*    if (!env_saved) return;
  326. */
  327.     env_saved = '\0';        
  328.     wa = &avl_windows[avl_window];
  329.     d = (short *) 0xb8000;
  330.     p =  wa -> sw.video;
  331.     s = (short *) p;
  332.     for(i = 0; i < 2000; ++i) {
  333.         c = *s;
  334.         att = *s >> 8;        
  335.         AVL_WVIDEO(c,att,d);
  336.         ++s;
  337.         ++d;
  338.         }
  339. /*    memmove(0xb8000, wa -> sw.video, 4000);
  340. */    _settextwindow(wa -> sw.r1,wa -> sw.c1,wa -> sw.r2,wa -> sw.c2);
  341.     _setbkcolor(wa -> sw.bk);
  342.     _settextcolor(wa -> sw.co);
  343.     _settextposition(wa -> sw.pos.row, wa -> sw.pos.col);
  344. }
  345.  
  346.  
  347. void AVL_DO_WINDOW()
  348. {
  349. }
  350.  
  351.  
  352. void AVL_ENVIRONMENT(int key)
  353. {
  354.     int ch, opt;
  355.     short att;
  356.     AVL_WIN_PTR w = NULL;
  357.     AVL_SAVE_ENV();
  358.     avl_env_win = NULL;
  359.     if (avl_open_error_file)  {
  360.         avl_open_error_file = 0;
  361.         avl_cur_menu = 0; 
  362.         AVL_OPEN_ERROR();
  363.         AVL_FIND(1,"*** ERROR: ");
  364.         return;
  365.         }
  366.     att = _settextcursor(0x2000);  /*  turn cursor off */
  367.     w = avl_env_win = AVL_MAKE_WINDOW(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  368.     if (key) {
  369.         switch( key ) {
  370.             case 'F' : avl_cur_menu = 0; break;
  371.             case 'E' : avl_cur_menu = 1; break;
  372.             case 'C' : avl_cur_menu = 2; break;
  373.             case 'B' : avl_cur_menu = 3; break;
  374.             case 'R' : avl_cur_menu = 4; break;
  375.             case 'W' : avl_cur_menu = 5; break;
  376.             case 'O' : avl_cur_menu = 6; break;
  377.             case 'A' : avl_cur_menu = 7; break;
  378.             case 'H' : avl_cur_menu = 8; break;
  379.             default  : {
  380.                 if (key == 0) key = getch();
  381.                 key = 0;
  382.                 AVL_ERROR("Invalid selection");
  383.                 break;
  384.                 }
  385.             }
  386.         }
  387.     while ( 1 ) {
  388.  
  389.         AVL_SHOW_MENU(); /*  Display top menu  */
  390.         AVL_MOUSE_ON();
  391.         AVL_MOUSE_SET(2,2);
  392.         _settextcursor(0x2000);
  393.         _settextposition(1,1);
  394.         if (key) {
  395.             ch = key;
  396.             key = 0;
  397.             }
  398.         else  
  399.             if (!kbhit())   {
  400.         
  401.                 if (!AVL_MOUSE_SELECT2(&ch))  
  402.                     continue;
  403.                 }
  404.             else {
  405.                 ch = getch();
  406.                 ch = toupper(ch);
  407.                 }
  408. back_here:
  409.         switch( ch ) {
  410.             case  27  : /* ESC : Abort Menu */
  411.                 _settextcursor(att);
  412.                 AVL_DEL_WINDOW(w);
  413.                 AVL_RESTORE_ENV();
  414.                 AVL_MOUSE_OFF();
  415.                 return;
  416.             case  13  : /* Engage current selection */
  417.                 AVL_SHOW_MENU();
  418.                 if (avl_cur_menu == 3)  {
  419.                     AVL_BIND();
  420.                     _settextcursor( att );
  421.                     break;
  422.                     }
  423.                 if (avl_cur_menu == 4)  {
  424.                     AVL_RUN();
  425.                     _settextcursor( att );
  426.                     break;
  427.                     }
  428.                 if (avl_cur_menu == 5)  {
  429.                     AVL_WINDOW();
  430.                     AVL_DEL_WINDOW(w);
  431.                     AVL_RESTORE_ENV();
  432.                     AVL_MOUSE_OFF();
  433.                     return;
  434.                     }
  435.                 opt = AVL_GET_SMENU_OPT();
  436.                 if (avl_cur_menu == 2 && avl_open_error_file)  {
  437.                     AVL_DEL_WINDOW(w);
  438.                     AVL_RESTORE_ENV();
  439.                     AVL_MOUSE_OFF();
  440.                     return;
  441.                     }
  442.                 _settextcursor( att );
  443.                 if (opt == 0)  {
  444.                     AVL_MOUSE_OFF();
  445.                     return;
  446.                     }
  447.                 break;
  448.             case 'F' : 
  449.                 avl_cur_menu = 0;
  450.                 AVL_SHOW_MENU();
  451.                 opt = AVL_GET_SMENU_OPT();
  452.                 _settextcursor( att );
  453.                 if (opt == 0)  {
  454.                     AVL_MOUSE_OFF();
  455.                     return;
  456.                     }
  457.                 break;
  458.             case 'E' : 
  459.                 avl_cur_menu = 1;
  460.                 AVL_SHOW_MENU();
  461.                 opt = AVL_GET_SMENU_OPT();
  462.                 _settextcursor( att );
  463.                 if (opt == 0)  {
  464.                     AVL_MOUSE_OFF();
  465.                     return;
  466.                     }
  467.                 break;
  468.             case 'C' : 
  469.                 avl_cur_menu = 2;
  470.                 AVL_SHOW_MENU();
  471.                 opt = AVL_GET_SMENU_OPT();
  472.                 if (avl_open_error_file)  {
  473.                     AVL_DEL_WINDOW(w);
  474.                     AVL_RESTORE_ENV();
  475.                     AVL_MOUSE_OFF();
  476.                     return;
  477.                     }
  478.                 _settextcursor( att );
  479.                 if (opt == 0)  {
  480.                     AVL_MOUSE_OFF();
  481.                     return;
  482.                     }
  483.                 break;
  484.             case 'B' :  /* Bind */
  485.                 avl_cur_menu = 3;
  486.                 AVL_SHOW_MENU();
  487.                 AVL_BIND();
  488.                 _settextcursor( att );
  489.                 break;
  490.             case 'R' : 
  491.                 avl_cur_menu = 4;
  492.                 AVL_SHOW_MENU();
  493.                 AVL_RUN();
  494.                 _settextcursor( att );
  495.                 break;
  496.             case 'W' : 
  497.                 avl_cur_menu = 5;
  498.                 AVL_SHOW_MENU();
  499.                 AVL_WINDOW();
  500.                 AVL_DEL_WINDOW(avl_env_win);
  501.                 AVL_RESTORE_ENV();
  502.                 AVL_MOUSE_OFF();
  503.                 return;
  504.             case 'O' :
  505.                 avl_cur_menu = 6;
  506.                 AVL_SHOW_MENU();
  507.                 opt = AVL_GET_SMENU_OPT();
  508.                 _settextcursor( att );
  509.                 if (opt == 0)  {
  510.                     AVL_MOUSE_OFF();
  511.                     return;
  512.                     }
  513.                 break;
  514.             case 'A' :
  515.                 avl_cur_menu = 7;
  516.                 AVL_SHOW_MENU();
  517.                 opt = AVL_GET_SMENU_OPT();
  518.                 _settextcursor( att );
  519.                 if (opt == 0)  {
  520.                     AVL_MOUSE_OFF();
  521.                     return;
  522.                     }
  523.                 break;
  524.             case 'H' : 
  525.                 avl_cur_menu = 8;
  526.                 AVL_SHOW_MENU();
  527.                 opt = AVL_GET_SMENU_OPT();
  528.                 _settextcursor( att );
  529.                 if (opt == 0)  {
  530.                     AVL_MOUSE_OFF();
  531.                     return;
  532.                     }
  533.                 break;
  534.             case 0   : 
  535.             case 0XE0: {
  536.                 ch = getch();
  537.                 switch(ch)  {
  538.                     case 75 : /* Left  */ 
  539.                         if (avl_cur_menu > 0) 
  540.                             --avl_cur_menu; 
  541.                         else
  542.                             avl_cur_menu = 8;
  543.                         break;
  544.                     case 77 : /* Right */ 
  545.                         if (avl_cur_menu < 8) 
  546.                             ++avl_cur_menu; 
  547.                         else
  548.                             avl_cur_menu = 0;
  549.                         break;
  550.                     case 33 : /* File */ ch = 'F'; goto back_here;
  551.                     case 18 : /* Edit */ ch = 'E'; goto back_here;
  552.                     case 46 : /* Comp */ ch = 'C'; goto back_here;
  553.                     case 48 : /* Bind */ ch = 'B'; goto back_here;
  554.                     case 19 : /* Run  */ ch = 'R'; goto back_here;
  555.                     case 17 : /* Wind */ ch = 'W'; goto back_here;
  556.                     case 24 : /* Opti */ ch = 'O'; goto back_here;
  557.                     case 30 : /* Ada  */ ch = 'A'; goto back_here;
  558.                     case 35 : /* Help */ ch = 'H'; goto back_here;
  559.                     case 59 : /* F1   */ AVL_HOT_KEYS(); break;
  560.                     case 107: /* Alt-F4   */ AVL_EXIT(); 
  561.                                              AVL_MOUSE_OFF();
  562.                                              return;
  563.                     default : putch(7); break;
  564.                     }
  565.                 }
  566.             }
  567.         }
  568. }
  569.  
  570. void AVL_COMP_SMENU(int *rows, int *cols)
  571. {
  572.     int i, j;
  573.     *rows = *cols = 0;
  574.     for(i = 0; *(avl_smenu[avl_cur_menu].s[i].sm) != '\0'; ++i) {
  575.         j = strlen(avl_smenu[avl_cur_menu].s[i].sm);
  576.         *rows += 1;
  577.         if (j > *cols) *cols = j;
  578.         }
  579. }
  580.  
  581.  
  582. void AVL_SHOW_MENU()
  583. {
  584.     int i;
  585.     short co;
  586.  
  587.     for (i = 0; i < AVL_MENU_ITEMS; ++i)  {
  588.         _settextposition(avl_menu[i].r,avl_menu[i].c);
  589.         if (i != 9)
  590.             if (i == avl_cur_menu)
  591.                 co = _settextcolor(avl_men_ready);
  592.             else
  593.                 co = _settextcolor(avl_men_letter);
  594.         else 
  595.             co = _settextcolor(15);
  596.         _outmem(avl_menu[i].tit,1);
  597.         if ((i != 9) && (i != avl_cur_menu))
  598.             _settextcolor(avl_men_word);
  599.         _settextposition(avl_menu[i].r,avl_menu[i].c+1);
  600.         _outtext(avl_menu[i].tit+1);
  601.         _settextcolor(co);
  602.         }
  603. }
  604.  
  605.